package com.tootallgavin.uttt;

/**
* Created with IntelliJ IDEA.
* User: Owner
* Date: 6/27/13
* Time: 4:42 AM
* To change this template use File | Settings | File Templates.
*/
public enum State {
    P2WIN(-2),
    P1WIN(-1),
    EMPTY(0),
    PLAYER1(1),
    PLAYER2(2);

    private int mValue;

    State(int value) {
        mValue = value;
    }

    public int getValue() {
        return mValue;
    }

    public static State fromInt(int i) {
        for (State s : values()) {
            if (s.getValue() == i) {
                return s;
            }
        }
        return EMPTY;
    }
}
